-
Notifications
You must be signed in to change notification settings - Fork 140
ASoC: SOF: Intel: reset link_mask before adding new bits #5646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: topic/sof-dev
Are you sure you want to change the base?
Conversation
e96ecb5 to
036b144
Compare
| return NULL; | ||
|
|
||
| /* Get link mask and link number */ | ||
| link_mask = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so are you saying that setting link_mask to during init implies a peripheral connect on link 0?
Also you have a typo in "at lease" ->"at least"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link_mask here will be set to mach->mach_params.link_mask. Each bit represents a link with a peripheral connected. For example, link_mask = 0xc means link 2 and 3 are enabled and with at least a peripheral connected.
Fixed the typo of the commit message.
link_mask is set to hdev->info.link_mask at the beginning of hda_sdw_machine_select(). However, some SDW links may not have any peripheral connected. We should set the mask bits where at least one peripheral is connected. Fixes: 5226d19 ("ASoC: SOF: Intel: use sof_sdw as default SDW machine driver") Signed-off-by: Bard Liao <[email protected]>
036b144 to
a217204
Compare
| return NULL; | ||
|
|
||
| /* Get link mask and link number */ | ||
| link_mask = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention that the local link_mask is used for two different purposes and needs to be initialized before each use?
| return NULL; | ||
|
|
||
| /* Get link mask and link number */ | ||
| link_mask = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bardliao I think you need to change to a new variable here instead of using link_mask. The link_mask variable is used for checking which links are enabled in ACPI and this one checks if there's a peripheral at any of the links.
link_mask is set to hdev->info.link_mask at the beginning of hda_sdw_machine_select(). However, some SDW links may not have any peripheral connected. We should reset it to 0 before adding the link id bits to the link_mask. Otherwise, the link_index will not start with 0 if the link_mask include any link that without peripheral.
Fixes: 5226d19 ("ASoC: SOF: Intel: use sof_sdw as default SDW machine driver")